﻿using System;
using MathNet.Numerics.LinearAlgebra.Double;
using MathNet.Numerics.LinearAlgebra.Generic;

namespace innovations.util
{
    public static class RandomWeights
    {
        public static Matrix<double> Initialize(int INPUT_LAYER_SIZE, int HIDDEN_LAYER_SIZE)
        {
            const double INITIAL_EPISLON = 0.12;
            Random random = new Random();
            Matrix<double> randomMatrix = new DenseMatrix(INPUT_LAYER_SIZE, HIDDEN_LAYER_SIZE);
            for (int i = 0; i < randomMatrix.RowCount; i++)
            {
                for (int j = 0; j < randomMatrix.ColumnCount; j++)
                {
                    randomMatrix[i, j] = random.NextDouble() * 2 * INITIAL_EPISLON - INITIAL_EPISLON;
                }
            }
            return randomMatrix;
        }
    }
}
